<template>
  <div class="leftMenu">
    <el-row>
      <el-col :span="12">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>首页</span>
            </template>
            <el-menu-item index="1-1">echarts</el-menu-item>
            <el-menu-item index="1-2">百度api</el-menu-item>
            <el-menu-item index="1-3">高德api</el-menu-item>
          </el-submenu>
          <el-menu-item index="/student">
            <i class="el-icon-menu"></i>
            <span slot="title">学生栏</span>
          </el-menu-item>
          <el-menu-item index="3" disabled>
            <i class="el-icon-document"></i>
            <span slot="title">领导栏</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title">老师栏</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style lang="less" scope>
.leftMenu {
  height: 100%;
  .el-col-12 {
    width: 200px;
  }
}
.el-row,
.el-col,
.el-menu {
  height: 100%;
}
</style>
